For an overview of the Compression Library and its buffering strategy,
see CLintro(3dm).
Implicit buffers in the CL are ring buffers with the newest data filled
in at the head and the oldest data removed at the tail. The calls to
read and write data operate on block counts. The size of a block is the
frame size in bytes for buffer type CL_BUF_FRAME, and is 1 byte for
buffer type CL_BUF_COMPRESSED.
ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee is used to find out how much free space is available and
where it is.
ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd is used to notify the library that data has been placed in
the ring buffer.
ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd is used to find out how much valid data is available and
where it is.
ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll is used to notify the library that valid data has been
consumed from the ring buffer and is no longer needed.
ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd is used to notify the library that no more data will
be written to the ring buffer, in which case readers of the buffer will
not block waiting for data to arrive.
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
Each routine returns a negative error code on failure.
On success, ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee and ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd return the number of free or
valid blocks that are available before wrapping, ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd and
ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll return the number of blocks updated, and ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd
returns SUCCESS.
NNNNOOOOTTTTEEEE
In the case of valid data which is wrapped and is in two segments, the
first segment can be accessed through _v_a_l_i_d_D_a_t_a and the pointer to the
second segment is the beginning of the ring buffer. This pointer to the
beginning of the ring buffer can be accessed by calling ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll.
EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
1111.... RRRReeeeccccoooorrrrdddd
/* Create the frame (input) and compressed (output) buffers */